package com.dindang.ddm.mvp.ui.activity;

import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v4.view.ViewPager;
import android.widget.TextView;

import com.dindang.ddm.di.component.DaggerMainComponent;
import com.dindang.ddm.di.module.AboutDingDangModule;
import com.dindang.ddm.di.module.MainModule;
import com.jess.arms.base.BaseActivity;
import com.jess.arms.di.component.AppComponent;
import com.jess.arms.utils.ArmsUtils;

import com.dindang.ddm.di.component.DaggerAboutDingDangComponent;
import com.dindang.ddm.mvp.contract.AboutDingDangContract;
import com.dindang.ddm.mvp.presenter.AboutDingDangPresenter;

import com.dindang.ddm.R;


import butterknife.BindView;

import static com.jess.arms.utils.Preconditions.checkNotNull;


/**
 * ================================================
 * Description:
 * <p>
 * Created by MVPArmsTemplate on 04/22/2019 15:35
 * <a href="mailto:jess.yan.effort@gmail.com">Contact me</a>
 * <a href="https://github.com/JessYanCoding">Follow me</a>
 * <a href="https://github.com/JessYanCoding/MVPArms">Star me</a>
 * <a href="https://github.com/JessYanCoding/MVPArms/wiki">See me</a>
 * <a href="https://github.com/JessYanCoding/MVPArmsTemplate">模版请保持更新</a>
 * ================================================
 */
public class AboutDingDangActivity extends BaseActivity<AboutDingDangPresenter> implements AboutDingDangContract.View {
    @BindView(R.id.version)
    TextView version;
    @Override
    public void setupActivityComponent(@NonNull AppComponent appComponent) {
        DaggerAboutDingDangComponent //如找不到该类,请编译一下项目
                .builder()
                .appComponent(appComponent)
                .aboutDingDangModule(new AboutDingDangModule(this))
                .build()
                .inject(this);
    }

    @Override
    public int initView(@Nullable Bundle savedInstanceState) {
        return R.layout.activity_about_ding_dang; //如果你不需要框架帮你设置 setContentView(id) 需要自行设置,请返回 0
    }

    @Override
    public void initData(@Nullable Bundle savedInstanceState) {
        mPresenter.init();
    }

    @Override
    public void showLoading() {

    }

    @Override
    public void hideLoading() {

    }

    @Override
    public void showMessage(@NonNull String message) {
        checkNotNull(message);
        ArmsUtils.snackbarText(message);
    }

    @Override
    public void launchActivity(@NonNull Intent intent) {
        checkNotNull(intent);
        ArmsUtils.startActivity(intent);
    }

    @Override
    public void killMyself() {
        finish();
    }

    @Override
    public BaseActivity getActivity() {
        return this;
    }

    @Override
    public TextView getVersion() {
        return version;
    }
}
